package com.pankaj.mapview;

import java.util.List;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;
import com.pankaj.mapview.R;

public class GooglemapActivity extends MapActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        MapView mapView = (MapView) findViewById(R.id.mapview);
        mapView.setBuiltInZoomControls(true);
        mapView.setSatellite(true);
        Log.d("Tag","1");
        List<Overlay> mapOverlays = mapView.getOverlays();
        Log.d("Tag","2");
        Drawable drawable = this.getResources().getDrawable(R.drawable.pin10);
        Log.d("Tag","3");
        Hello itemizedoverlay = new Hello(drawable,this);
        Log.d("Tag","4");
        //http://www.getlatlon.com/
        //GeoPoint point = new GeoPoint(21504394,82717670);
        //OverlayItem overlayitem = new OverlayItem(point, "india!", "india");
        //GeoPoint point2 = new GeoPoint(23016320,72613590);
        
        GeoPoint point2 = new GeoPoint(23083874,72552065);
        Log.d("Tag","5");
        OverlayItem overlayitem2 = new OverlayItem(point2, "ahm!", "I'm in Ahmedabad!");
        Log.d("Tag","6");
        MapController mControl;
        Log.d("Tag","7");
        mControl = mapView.getController();
        mControl.animateTo(point2);
        mControl.setZoom(20);
        Log.d("Tag","8");
        itemizedoverlay.addOverlay(overlayitem2);
        Log.d("Tag","9");
        mapOverlays.add(itemizedoverlay);
        Log.d("Tag","10");
    
    }
	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}
}